package com.jinlia.show.modules.system.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jinlia.show.modules.base.model.po.PayOrderPO;
import com.jinlia.show.modules.base.model.query.PayOrderQuery;
import com.jinlia.show.modules.base.model.vo.PayOrderVO;
import com.jinlia.show.modules.base.wxapp.entity.PayOrderRecord;
import com.jinlia.show.modules.base.wxapp.service.PayOrderMapperService;
import com.jinlia.show.modules.base.wxapp.service.PayOrderRecordMapperService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/payOrderRecord")
public class PayOrderRecordController {
    @Autowired
    PayOrderRecordMapperService payOrderRecordMapperService;


    @PostMapping("/getPage")
    public ResponseEntity<Page<PayOrderRecord>> getPageVO(@RequestBody PayOrderQuery payOrderQuery) {
        Page<PayOrderRecord> res = payOrderRecordMapperService.getPage(payOrderQuery);
        return ResponseEntity.ok(res);
    }
    /**
     * 支付记录
     *
     * @param payOrderRecord
     * @return
     */
    @PostMapping("/add")
    public ResponseEntity<PayOrderRecord> addPayOrderRecord(@RequestBody PayOrderRecord payOrderRecord) {
        PayOrderRecord res = payOrderRecordMapperService.addPayOrderRecord(payOrderRecord);
        return ResponseEntity.ok(res);
    }
}
